package com.yc.sole.erp.enums;

import com.fasterxml.jackson.annotation.JsonValue;
import com.yc.sole.common.enums.IBaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author yizuomin
 * @date 2024/3/10 10:33
 **/
@Getter
@AllArgsConstructor
public enum ShipmentType implements IBaseEnum<String> {

    /**
     *
     */
    SELF("0", "厂车配送"),
    EXPRESS("1", "快递配送"),
    LOGISTICS("2", "物流配送"),
    CUSTOMER_PICKUP("3", "客户自提"),
    ;

    @JsonValue
    private final String value;
    private final String description;

    public static String getByValue(String value) {
        for (ShipmentType state : ShipmentType.values()) {
            if (state.getValue().equals(value)) {
                return state.getDescription();
            }
        }
        return null;
    }
}
